<template>
	<view>
		<view
			style="width: 85%;margin: 30rpx auto;background-color: #75dccb;padding: 30rpx;border-radius: 30rpx;color: #fff;">
			<view style="display: flex;justify-content: space-between;align-items: center;">
				<view style="display: flex;justify-content: flex-start;line-height: 60rpx;align-items: center;">
					<image src="../../../static/image/4.jpg" style="width: 150rpx;height: 150rpx;margin-right: 20rpx;"
						mode="aspectFill">
					</image>
					<text>李克</text>
				</view>
			</view>
			<view style="display: flex;justify-content: space-around;text-align: center;margin-top: 40rpx;">
				<view class="item">
					<text>3单</text><br />
					<text>完成订单</text>
				</view>
				<view class="item">
					<text>30公里</text><br />
					<text>配送里程</text>
				</view>
			</view>
		</view>
		<u-cell-group>
			<u-cell @click="topage" name="0" :isLink="true" icon="star" title="评价记录"></u-cell>
			<u-cell @click="topage" name="1" :isLink="true" icon="coupon" title="修改密码"></u-cell>
			<u-cell @click="topage" name="2" :isLink="true" icon="integral" title="更改手机号"></u-cell>
			<u-cell @click="topage" name="3" :isLink="true" icon="setting" title="清除缓存"></u-cell>
		</u-cell-group>
		<button type="default" @click="logOut"
			style="width: 80%;margin-top: 30rpx;border: #75dccb 1rpx solid;background-color: #f2f2f2;color: #19c4c7;">退出登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			logOut(){
				uni.navigateTo({
					url:'../login/login'
				})
			},
			toSignin() {
				uni.navigateTo({
					url: './signin'
				})
			},
			topage(e) {
				console.log(Number(e.name));
				switch (Number(e.name)) {
					case 0:
						// 评价记录
						uni.navigateTo({
							url: './my/evaluationRecord'
						})
						break;
					case 1:
						// 修改密码
						uni.navigateTo({
							url: '../setup/updatePassword'
						})
						break;
					case 2:
						// 更改手机号码
						uni.navigateTo({
							url: '../setup/changeMobile'
						})
						break;
					case 3:
						// 清除缓存
						uni.clearStorage();
						uni.$u.toast('清除成功')
						break;
				}
			}
		}
	}
</script>

<style>
	.item {
		width: 100%;
	}
</style>
